package router

import (
	"api/handler"
	"api/pkg"
	"github.com/gin-gonic/gin"
)

func Router(r *gin.Engine) {
	api := r.Group("api")
	{
		user := api.Group("user")
		{
			user.POST("/login", handler.Login)
			user.POST("/upload", handler.Upload)
			user.POST("/addvideo", handler.AddVideo)

		}

		video := api.Group("video")
		{

			video.GET("/video", handler.ListVideo)
			video.Use(pkg.JWTAuth("2210a"))
			video.GET("/info", handler.InfoVideo)
		}
	}
}
